package com.hhb.leetCode.剑指offer;

public class Test53_2 {
    public static void main(String[] args) {
        int[] arr = new int[]{0,1,2,3,4,5,6,7,9};
        int i = Solution1.missingNumber(arr);
        System.out.println(i);
    }
}

class Solution1 {
    public static int missingNumber(int[] nums) {

        for (int i = 0; i < nums.length; i++) {
            if (nums[i]+1 != nums[i+1]){
                return nums[i]+1;
            }
        }
        return 0;
    }
}
